// UDMv4.5 // Sliding Menus extension v1.03 //
/***************************************************************\

  ULTIMATE DROP DOWN MENU Version 4.5 by Brothercake
  http://www.udm4.com/
  
\***************************************************************/

/***************************************************************\
* Set animation parameters
\***************************************************************/

var sliders=[
	"50",	// duration ["milliseconds"]
	"15",	// resolution ["frames"]
	"ttb",	// opening transition ["ltr"|"rtl"|"ttb"|"btt"|"tlbr"|"trbl"|"bltr"|"brtl"|"cve"|"che"|"ctc"|"rnd"|"none"]
	"btt",	// closing transition [same choices]
	"no",	// allow cross transitions ["yes"|"no"]
	];

/***************************************************************\
\***************************************************************/
var sm=new Object;um.sim=(!(um.mie||um.og||um.k||(um.o7&&!um.o75)));sm.v=sliders;sm.m={'o':null,'c':null};sm.c={'o':null,'c':null};sm.t={'o':null,'c':null};sm.s={'o':1,'c':1};sm.n='rect(-10000px,10000px,10000px,-10000px)';sm.ds=['ltr','rtl','ttb','btt','tlbr','trbl','bltr','brtl','cve','che','ctc'];for(var i=0;i<2;i++){sm.v[i]=um.pi(sm.v[i]);}if(/mac/.test(um.u)){sm.v[1]=sm.v[1]/2;}sm.gpn=function(node){return node.parentNode.parentNode;};if(um.sim){um.addReceiver(menuOpening,'060');um.addReceiver(menuClosing,'070');}function menuOpening(menu){if(um.ha){return false;}if(sm.t.o!=null){clipLayers(sm.c.o,sm.n);clearInterval(sm.t.o);sm.t.o=null;sm.s.o=1;}else if(sm.t.c!=null){if(sliders[4]=='no'){clearInterval(sm.t.c);sm.t.c=null;sm.s.c=1;}if(sliders[4]=='no'||sm.gpn(sm.m.c)!=sm.gpn(menu)){sm.tmp=um.gu(sm.gpn(menu));sm.tmpLen=sm.tmp.length;if(sm.tmpLen>0){for(i=0;i<sm.tmpLen;i++){if(sm.tmp[i]!=menu){removeMenu(sm.tmp[i]);}}}}}sm.d=(sm.v[2]=='rnd')?sm.ds[Math.floor(Math.random()*sm.ds.length)]:sm.v[2];if(sm.d!='none'){if((um.wie50&&um.e[13]=='default')||(um.wie&&um.e[13]=='hide')){um.n.ts('hidden');}clipLayers(menu,'rect(0,0,0,0)');sm.m.o=menu;sm.sz={x:menu.offsetWidth+5,y:menu.offsetHeight+5};sm.t.o=setInterval('animateMenu(sm.m.o,sm.d,"o",sm.sz)',sm.v[0]/sm.v[1]);}return true;};function menuClosing(menu){if(um.ha){return false;}if(sm.t.o!=null){if(um.mf){removeMenu(sm.m.o);clearInterval(sm.t.o);sm.t.o=null;sm.s.o=1;}else if(sm.gpn(sm.m.o)==sm.gpn(menu)){if(sm.t.c!=null){removeMenu(sm.m.o);}clearInterval(sm.t.o);sm.t.o=null;sm.s.c=sm.v[1]-sm.s.o;sm.s.o=1;}else{removeMenu(menu);}}if(um.mf){removeMenu(menu);clearInterval(sm.t.c);sm.t.c=null;sm.s.c=1;}else if(sm.t.c==null){sm.d=(sm.v[3]=='rnd')?sm.ds[Math.floor(Math.random()*sm.ds.length)]:sm.v[3];if(sm.d!='none'){sm.m.c=menu;sm.sz={x:menu.offsetWidth+5,y:menu.offsetHeight+5};sm.t.c=setInterval('animateMenu(sm.m.c,sm.d,"c",sm.sz)',sm.v[0]/sm.v[1]);}else{removeMenu(menu);}}return true;};function animateMenu(menu,dir,ide,siz){sm.c[ide]=menu;if(ide=='c'){if(dir!='none'){dir=dir.toUpperCase();}}sm.clip='rect('+ (/(btt|bltr|brtl)/.test(dir)?(siz.y-((siz.y/sm.v[1])*sm.s[ide])):(/(TTB|TLBR|TRBL)/.test(dir)?((siz.y/sm.v[1])*sm.s[ide]):(/(che|ctc)/.test(dir)?((siz.y/2)-((siz.y/sm.v[1])*(sm.s[ide]/2))):(/(CHE|CTC)/.test(dir)?((siz.y/sm.v[1])*(sm.s[ide]/2)):0))))+ 'px,' + (/(ltr|tlbr|bltr)/.test(dir)?((siz.x/sm.v[1])*sm.s[ide]):(/(RTL|TRBL|BRTL)/.test(dir)?(siz.x-((siz.x/sm.v[1])*sm.s[ide])):(/(cve|ctc)/.test(dir)?((siz.x/2)+((siz.x/sm.v[1])*(sm.s[ide]/2))):(/(CVE|CTC)/.test(dir)?(siz.x-((siz.x/sm.v[1])*(sm.s[ide]/2))):siz.x)))) + 'px,' + (/(ttb|tlbr|trbl)/.test(dir)?((siz.y/sm.v[1])*sm.s[ide]):(/(BTT|BLTR|BRTL)/.test(dir)?(siz.y-((siz.y/sm.v[1])*sm.s[ide])):(/(che|ctc)/.test(dir)?((siz.y/2)+((siz.y/sm.v[1])*(sm.s[ide]/2))):(/(CHE|CTC)/.test(dir)?(siz.y-((siz.y/sm.v[1])*(sm.s[ide]/2))):siz.y))))+ 'px,' + (/(rtl|trbl|brtl)/.test(dir)?(siz.x-((siz.x/sm.v[1])*sm.s[ide])):(/(LTR|TLBR|BLTR)/.test(dir)?((siz.x/sm.v[1])*sm.s[ide]):(/(cve|ctc)/.test(dir)?((siz.x/2)-((siz.x/sm.v[1])*(sm.s[ide]/2))):(/(CVE|CTC)/.test(dir)?((siz.x/sm.v[1])*(sm.s[ide]/2)):0)))) + 'px)';clipLayers(menu,sm.clip);sm.s[ide]++;if(sm.s[ide]>(sm.v[1]+1)||dir=='none'){clearInterval(sm.t[ide]);sm.t[ide]=null;sm.s[ide]=1;sm.c[ide]=menu;clipLayers(menu,sm.n);if(ide=='c'){removeMenu(menu);if((um.wie50&&um.e[13]=='default')||(um.wie&&um.e[13]=='hide')){if(sm.gpn(menu).className=='udm'&&sm.t.o==null){um.n.ts('visible');}}}}};function clipLayers(layer,clipBy){layer.style.clip=clipBy;layer.s=getRelatedLayer(layer,'udmS');if(layer.s!=null){layer.s.style.clip=clipBy;}layer.c=getRelatedLayer(layer,'udmC');if(layer.c!=null){layer.c.style.clip=clipBy;}};function removeMenu(menu){clipLayers(menu,sm.n);menu.s=getRelatedLayer(menu,'udmS');if(menu.s!=null){menu.parentNode.removeChild(menu.s);}menu.c=getRelatedLayer(menu,'udmC');if(menu.c!=null){menu.parentNode.removeChild(menu.c);}menu.style.visibility='hidden';menu.style.display='none';};function getRelatedLayer(menuNode,menuClass){sm.node=menuNode.parentNode.lastChild;if((um.wie55&&(um.e[13]=='default'||um.e[13]=='iframe')&&menuClass=='udmS')||sm.node.nodeName=='#text'){sm.node=sm.node.previousSibling;}if(sm.node.className){if(sm.node.className.indexOf(menuClass)!=-1){return sm.node;}else{return null;}}else{return null;}};